import request from '@/libs/axios'

export const task = params => {
  return request({
    url: '/task',
    method: 'get',
    params: params
  })
}

export const addTask = params => {
  return request({
    url: '/task',
    method: 'post',
    data: params
  })
}

export const showTask = params => {
  return request({
    url: '/task/' + params.id,
    method: 'get',
    params: params
  })
}

export const editTask = params => {
  return request({
    url: '/task/' + params.id,
    method: 'put',
    data: params
  })
}

export const deleteTask = params => {
  return request({
    url: '/task/' + params.id,
    method: 'delete',
    data: params
  })
}

export const rollbackTask = params => {
  return request({
    url: '/task/rollback/' + params.id,
    method: 'post',
    data: params
  })
}

export const branch = params => {
  return request({
    url: '/task/branch',
    method: 'get',
    params: params
  })
}

export const tag = params => {
  return request({
    url: '/task/tag',
    method: 'get',
    params: params
  })
}

export const version = params => {
  return request({
    url: '/task/version',
    method: 'get',
    params: params
  })
}

export const audit = params => {
  return request({
    url: '/task/audit',
    method: 'post',
    data: params
  })
}
